﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <div id="js-console"></div>
    <script src="scripts/js-console.js"></script>
    <script>
        function checkForPointInCircle(x, y) {
            var inCircle = true;
            var pythagorean = Math.pow((x - 1), 2) + Math.pow((y - 1), 2);
            if (pythagorean > 9) {
                inCircle = false;
            }

            return inCircle;
        }

        function checkForPointInRectangle(x, y) {
            var outRectangle = true;

            if ((x <= 5 && x >= -1) && (y <= 1 && y >= -1)) {
                outRectangle = false;
            }

            return outRectangle;
        }

        function inCircleAndOutsideOfRectangle(x, y) {
            if (checkForPointInCircle(x, y) && checkForPointInRectangle(x, y)) {
                return true;
            }
            else {
                return false;
            }
        }

        jsConsole.writeLine(inCircleAndOutsideOfRectangle(0, 2));
        jsConsole.writeLine(inCircleAndOutsideOfRectangle(1, -0.5));
    </script>
</body>
</html>